package cate.game.play.skill.passive.fairy;

import cate.game.play.config.PlayCfgArgs;
import cate.game.play.fighter.Fighter;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 法国蜗牛在场时，敌方每死亡1次，提升我方所有单位5%防御和伤害减免，最高5层，持续到战斗结束；
 */
public class 法国蜗牛灵器PH extends PassiveHandler {

	private int buff;

	//buff=??
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		buff = args.getInt("buff", 0);
	}

	@Override
	public void onOtherDead(ActionCtx action, Fighter killer, Fighter deader) {
		if (skill.owner.isDead()) {
			return;
		}
		if (skill.owner.getTeam() == deader.getTeam()) {
			return;
		}
		for (Fighter target : skill.owner.getFightTeam().getFightersAlive()) {
			target.buff.tryAddByTid(action,skill.owner, buff);
		}
	}
}
